home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995…tember: Reference Library / Dev.CD Sep 95 RL / Dev.CD Sep 95 RL.toast / mac / Technical Documentation / develop / develop Issue 20 code / Pict Tricks / CLUTLess / CLUTLess.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-28  |  1.5 KB  |  44 lines  |  [TEXT/MMCC]

  1.  
  2. /*     
  3.                             CLUTLess
  4.             In some instances it is desireable to store picts stripped of
  5.             CLUTs in order to save some room in the disk. This sample shows
  6.             how to create such picts and how to properly display them back.
  7.             
  8.             SimpleInC.c -- initialization stuff and event loop
  9.             CLUTLess.c  -- code that does the creation of the clut less pict;
  10.                            shows also how to display the pictures.
  11.     
  12. */
  13.  
  14. /* all the includes we need. */
  15. #include <Memory.h>
  16. #include <QDOffscreen.h>
  17. #include <Resources.h>
  18. #include <StandardFile.h>
  19. #include <ToolUtils.h>
  20.  
  21. #define     desiredDepth     8            // the exercise is meant for eight bit deep images
  22. #define        pictID            128            // source image
  23.  
  24. PicHandle         gOrigPict     = 0L,         // Holds the original picture
  25.                 gModPict     = 0L,         // for the modified picture
  26.                 gCurrPict     = 0L;        // pict to be used when updating the window
  27. extern             CTabHandle     gSharedClut;     // we use this to create the 'clut' resource
  28.                                             // later we use it for reading in the 'clut'
  29.  
  30. /* clutless.c */
  31. Boolean     SetupPictures(void);
  32. PicHandle     CreateCLUTLessPict(GWorldPtr myGWorld);
  33. Boolean     SaveCLUTLessPict(PicHandle aPict);
  34. pascal void AddClutProc(BitMap *src, Rect *srcR, Rect *dstR, short mode, RgnHandle msk);
  35. void        InitProcs(CQDProcs *theProcs);
  36. Boolean     SavePicture(void);
  37.  
  38. /* clutlessFile.c */
  39. extern short     OpenPictureFile(SFReply *reply);
  40. extern void        KillFile(short ref, SFReply *reply);
  41. extern void     ClosePictureFile(short ref, SFReply *reply, PicHandle aPict);
  42. extern void     SaveCLUTResource(SFReply *sfr);
  43. extern Boolean     GetPictBack(void);
  44.